package com.akcome.hades.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSON;

/**
 * kafka 消息消费
 * @author wn
 *
 */
@Component
public class KafkaReceiver {
	
	private Logger logger = LoggerFactory.getLogger(this.getClass());
	
	@Autowired
    private KafkaTemplate<String, String> kafkaTemplate;
	
	/**
	 * 通知
	 * @param content
	 */
	@KafkaListener(topics = "artemis.notice")
    public void notice(String content) throws Exception {
        
		//发送消息
		kafkaTemplate.send("artemis.notice", "content");

    }
}
